package com.javaking.clanteam.studentutils.utils;

import java.util.List;
import java.util.Map;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.SimpleAdapter;
import android.widget.TextView;

import com.javaking.clanteam.studentutils.R;

public class ListAdapter extends SimpleAdapter {
	
	private static final int[] to = {R.id.itemString};
	private static final String[] from = {"item"};
	
	public ListAdapter(Context context, List<? extends Map<String,?>> data) {
		super(context,data,R.layout.fragment_editablelistitem,from,to);
	}
	
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {		
		View v = super.getView(position, convertView, parent);
		((TextView)v.findViewById(R.id.itemNumber)).setText(String.valueOf(position+1)+")");
		return v;
	}

}
